package xuesm.singleton.lazy;

/**
 * @Author: xuesm
 * @Description: 懒汉式， 双重锁
 * @Date: Create in 12:49 2019/3/28
 */
public class LazyDoubleCheckSingleton {

	private LazyDoubleCheckSingleton(){};

	private static LazyDoubleCheckSingleton lazy = null;

	public static LazyDoubleCheckSingleton  getInstance(){
		if (lazy == null){
			synchronized (LazyDoubleCheckSingleton.class){
				if (lazy == null){
					lazy = new LazyDoubleCheckSingleton();
				}
			}
		}

		return lazy;
	}
}
